#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
    int a;
    vector<int> v;
    cin >> a;
    while (cin >> a)
        v.push_back(a);
    sort(v.begin(), v.end(), greater<int>());
    cout << v[0] << " " << v[1] << " " << v[2] << " " << v[3] << " " << v[4] << " " << endl;
}
